<?php
class form {

public $content;
var $method;
var $form_name;
var $form_id;
var $class;

function __construct($method, $action, $form_name, $form_id, $class=""){
	$this->content = "<form method=" . $method . "action=" . $action . " name=" . $form_name . " id=" . $form_id . " class=" . $class . " >
	";
}

public function newInput($name, $id, $type, $title="", $title_class="", $value="") {
	if ($type == "text") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "button") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "checkbox") {
	}
	else if ($type == "password") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "radio") {
	}
	else if ($type == "hidden") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "select") {
	}
	else if ($type == "textarea") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "image") {
	}
	else if ($type == "submit") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	else if ($type == "reset") {
		$new_content = "<span class=" . $title_class . ">" . $title . "</span><input type=" . $type . " name=" . $name . " id=" . $id . " value=" . 
		$value . "><br>";
	}
	
	$this->content = $this->content . $new_content;
}

public function printForm(){
	$this->content = $this->content . "</form>";
	echo $this->content;
}

}

$formulario = new form("post", "", "cacapedo", "19");

$formulario->newInput("name", "id", "type", /*opcionales*/"title", "titleclass", "value");

$formulario->printForm();


?>

